package com.iwdnb.gkgz.common.utils;

import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import cn.hutool.core.date.DateUtil;
import com.iwdnb.bmnf.common.exception.ExceptionsEnhancer;
import com.iwdnb.bmnf.common.utils.ClassUtils;
import lombok.Data;

public class StockIgnoreUtils {
    private static final String IGNORE_STOCK_YEAR_PATH = "ignoreStockYear.json";
    private static final JSONObject IGNORE_STOCK_YEAR;

    static {
        String content = ClassUtils.getFileContentList(IGNORE_STOCK_YEAR_PATH).get(0);
        IGNORE_STOCK_YEAR = JSON.parseObject(content);

    }

    public static boolean isYearEnable(String stockCode, String year) {
        if (!IGNORE_STOCK_YEAR.containsKey(stockCode)) {
            return true;
        }
        if (IGNORE_STOCK_YEAR.getString(stockCode).contains(year)) {
            return false;
        }
        return true;
    }

}
